package com.cafe.service.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cafe.dao.PlacardDao;
import com.cafe.model.Placard;
import com.cafe.service.PlacardService;
import com.malamute.core.common.Page;

/**
 * @Description 海报业务接口实现类
 * @version v1.0
 */
@Service
public class PlacardServiceImpl implements PlacardService {
	@Autowired
	private PlacardDao placardDao;

	@Override
	public void savePlacard(Placard placard) {
		placardDao.save(placard);
	}

	@Override
	public void updatePlacard(Placard placard) {
		placardDao.update(placard);
	}

	@Override
	public Placard getPlacardById(Integer id) {
		return placardDao.get(id);
	}

	@Override
	public void listPlacardsByPage(DetachedCriteria criteria, Page page) {
		placardDao.listByPage(criteria, page);
	}

	@Override
	public void deletePlacardById(Integer id) {
		placardDao.deleteByKey(id);
	}

	@Override
	public List listPlacards(DetachedCriteria criteria) {
		return placardDao.findByCriteria(criteria);
	}

}
